package org.hzz.promotions.domain.service;

import io.gitee.pkmer.convention.page.PageResponse;
import io.gitee.pkmer.convention.page.query.PageQuery;
import io.gitee.pkmer.ddd.shared.service.DomainService;
import org.hzz.promotions.domain.aggregate.CouponAggregate;
import org.hzz.promotions.domain.entity.UserCouponEntity;
import org.hzz.promotions.domain.valueobject.CouponReceive;

import java.util.List;
import java.util.Map;

/**
 * @author <a href="mailto:1193094618@qq.com">pkmer</a>
 * <br>
 * <a href = "https://gitee.com/developeros/videos-online">Code Repository</a>
 * At 2024/9/2
 * 用户优惠券相关领域服务
 */
public interface UserCouponDomainService extends DomainService {

    /**
     * 用户领取指定优惠券的数量
     * @param userId 用户id
     * @param couponIds 优惠券id 列表
     * @return 领取数量 id -> coupon
     */
    Map<Long, CouponReceive> userReceiveCouponNum(Long userId, List<Long> couponIds);


    /**
     * 领取优惠券
     * @param userCouponEntity 用户优惠券实体
     */
    void receiveCoupon(UserCouponEntity userCouponEntity);

    /**
     * 分页查询用户优惠券
     * @param pageQuery 分页查询条件
     * @return 用户优惠券列表
     */
    PageResponse<CouponAggregate> pagePage(PageQuery pageQuery);
}
